// CHAPTER 7 OF OBJECT ORIENTED JAVASCRIPT
// THE BROWSER ENVIRONMENT
mainchapter("7 THE BROWSER ENVIRONMENT");

(function(){
	// 7.1 WINDOW OBJECT
	chapter("7.1 WINDOW OBJECT");
	try{
		window.somevar = 1;
		assertEquals(somevar,1);
		success("7.1a window.somevar updates the global somevar");
	}catch(e){
		$ERROR("7.1a window.somevar updates the global somevar : "+e.message);
	}
	try{		
		window.somevar = 5;
		somevar = 3;
		assertEquals(somevar,3);
		assertEquals(window.somevar,3);
	}catch(e){
		$ERROR("7.1b global somevar updates the window.somevar : "+e.message);
	}
	try{
		assertEquals(window.parseInt('123a456'),123);
		success("7.1c window can execute global functions");
	}catch(e){
		$ERROR("7.1c window can execute global functions : "+e.message);
	}
})();

